package cn.tedu.char_mybatis.mapper;

import cn.tedu.char_mybatis.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Insert("INSERT INTO user(username,password,nickname) " +
            "values(#{username},#{password},#{nickname})")
    int setInsertUser(User user);

    @Select("SELECT nickname FROM user WHERE username=#{username} and password=#{password}")
    String getNickname(@Param("username") String username, @Param("password") String password);

}
